import styles from './index.module.less'
import type { ManageType } from '@/pages/report/department/interface'
import { ConditionRender } from './ConditionRender'

export const DepartmentReport = (props: { data?: ManageType }) => {
    const data = props.data

    return (
        <div className={styles.content}>
            <div>
                <p>{`${data?.create_date}`}</p>
                <p>{`${data?.platform || ''}正式上线启用`}</p>
            </div>

            <ConditionRender condition={Boolean(data?.is_show_basic_student)}>
                <div>
                    <p>
                        2024，在学员培训上开展了
                        <span>{`${data?.basic_student_module?.total_course_num || 0}`}</span>
                        类培训项目
                    </p>
                    <p>
                        <span>{`${data?.basic_student_module.total_group_num || 0}`}</span>
                        期培训班，共
                        <span>{`${data?.basic_student_module.total_student_num || 0}`}</span>
                        名参训学员
                    </p>
                    <p>
                        有
                        <span>{`${
                            data?.basic_student_module.total_quality_student_num || 0
                        }`}</span>
                        人培训合格，合格率
                        <span>{`${data?.basic_student_module.quality_percent || '0%'}`}</span>
                    </p>
                    <ConditionRender condition={Boolean(data?.is_show_course_student)}>
                        <p>
                            <span>{`${data?.course_student_module[0]?.course_name || '-'}`}</span>
                            参训学员最多
                        </p>
                    </ConditionRender>
                </div>
            </ConditionRender>

            <div>
                <ConditionRender condition={Boolean(data?.is_show_region_student)}>
                    <p>
                        开展创业培训最多的地区是
                        <span>{`【${data?.region_student_module[0]?.region || '-'}】`}</span>
                    </p>
                </ConditionRender>

                <ConditionRender condition={Boolean(data?.is_show_category_student)}>
                    <p>
                        参训学员类型最多的是
                        <span>{`【${data?.category_student_module.category || '-'}】`}</span>
                    </p>
                </ConditionRender>

                <ConditionRender condition={Boolean(data?.is_show_degree_student)}>
                    <p>
                        参训学员文化程度最多的是
                        <span>{`【${data?.degree_student_module.degree || '-'}】`}</span>
                    </p>
                </ConditionRender>
            </div>

            <ConditionRender condition={Boolean(data?.is_show_student_foster)}>
                <div>
                    <p>
                        在师资培养上开展了
                        <span>{`${data?.student_foster_module?.total_group_num || 0}`}</span>期班级
                    </p>
                    <p>
                        <span>{`共${data?.student_foster_module?.total_teacher_num || 0}`}</span>
                        名参训讲师
                    </p>
                </div>
            </ConditionRender>

            <div>
                <p>{`很荣幸能陪伴您走过${data?.live_day}天`}</p>
                <p>{`2025，${data?.platform}与您一起为创业之路，奠定坚实基础`}</p>
            </div>
        </div>
    )
}
